<%@ page language="java" pageEncoding="UTF-8" import="ll.sms.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>业务员注册</title>
		<link rel="stylesheet" type="text/css" href="../ext/ext-all.css" />
		<script type="text/javascript" src="../ext/ext-base.js"></script>
		<script type="text/javascript" src="../ext/ext-all.js"></script>
<%
String currentUserId = SmsUtil.sessionHelper(session,AdminProperty.aid);

 %>
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = '../images/s.gif';
</script>
	<script type="text/javascript">
	Ext.onReady(function(){
		Ext.QuickTips.init();
	    var simple = new Ext.FormPanel({
	    renderTo:'mt',
        //labelWidth: 80, // label settings here cascade unless overridden
        url:'../ajaxjsp/addoperator.jsp',
        frame:true,
        title: '业务员注册',
        bodyStyle:'padding:5px 5px 0',
        width: '50%',
        //defaults: {width: '60%'},
        defaultType: 'textfield',
        labelAlign: 'left',
        waitMsgTarget: true,
        items: [
        		{
        		fieldLabel: '代理ID',
                name: 'acompany',
                id:'acompany',
                xtype:'hidden'
				},

            {
                fieldLabel: '业务员名',
                name: 'auname',
                allowBlank:false,
                blankText :'管理员用户名必须填写'
            },{
                fieldLabel: '密码',
                name: 'apwd',
                vtype:'alphanum',
                vtypeText:'密码只能包括字母或者数字',
                allowBlank:false,

                blankText :'密码必须填写'
            },
            {
                fieldLabel: '重新输入密码',
                name: 'reapwd',
                vtype:'alphanum',
                vtypeText:'密码只能包括字母或者数字',
                allowBlank:false,

                blankText :'密码必须填写'
            }
            ,
            {
                fieldLabel: '可发短信数',
                name: 'asmsnum',
                xtype:'hidden'
               // allowBlank:false,
               // blankText :'可发短信数必须填写'
            },
             {
                fieldLabel: '是否可用',
                name: 'aavailable',
                xtype:'hidden'
            },{
                fieldLabel: '联系电话',
                name: 'alinkmanphone'
            },{
                fieldLabel: '联系人QQ',
                name: 'alinkmanqq'
            }
        ],

        buttons: [{
            text: '注册',
            handler : function(){

            simple.form.findField('acompany').setValue('<%=currentUserId%>');

            simple.form.submit({
					waitMsg : '正在处理......',
					success : function(form1, action) {
						simple.form.reset();
						Ext.Msg.alert('成功','操作成功');

					},
					failure : function(form, action) {
						//form.reset();
						if (action.failureType == Ext.form.Action.SERVER_INVALID){
							Ext.MessageBox.alert('错误',action.result.errors.msg);
							}else{
							Ext.MessageBox.alert('错误','----------非法输入----------');
							}
					}
				});
            }
        },{
            text: '重填',
            handler : function(){
          		simple.form.reset();
            }
        }]
    });

});
	</script>

  </head>

  <body bgcolor="#ffffff">
 <br>
    <div id="mt" align="center"></div>
    <div id= "inp"></div>
    <input id="sel" type="hidden"/>
  </body>
</html>
